
<!DOCTYPE HTML>
<html lang="" >
    <head>
        <meta charset="UTF-8">
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <title>使用方法 · GitBook</title>
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="description" content="">
        <meta name="generator" content="GitBook 3.2.3">
        
        
        
    
    <link rel="stylesheet" href="../gitbook/style.css">

    
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-highlight/website.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-search/search.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-fontsettings/website.css">
                
            
        

    

    
        
    
        
    
        
    
        
    
        
    
        
    

        
    
    
    <meta name="HandheldFriendly" content="true"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <link rel="apple-touch-icon-precomposed" sizes="152x152" href="../gitbook/images/apple-touch-icon-precomposed-152.png">
    <link rel="shortcut icon" href="../gitbook/images/favicon.ico" type="image/x-icon">

    
    <link rel="next" href="QRNormal.html" />
    
    
    <link rel="prev" href="../" />
    

    </head>
    <body>
        
<div class="book">
    <div class="book-summary">
        
            
<div id="book-search-input" role="search">
    <input type="text" placeholder="Type to search" />
</div>

            
                <nav role="navigation">
                


<ul class="summary">
    
    

    

    
        
        
    
        <li class="chapter " data-level="1.1" data-path="../">
            
                <a href="../">
            
                    
                    基本介绍
            
                </a>
            

            
        </li>
    
        <li class="chapter active" data-level="1.2" data-path="./">
            
                <a href="./">
            
                    
                    使用方法
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.2.1" data-path="QRNormal.html">
            
                <a href="QRNormal.html">
            
                    
                    QRNormal
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.2" data-path="QRRandRect.html">
            
                <a href="QRRandRect.html">
            
                    
                    QRRandRect
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.3" data-path="QRDsj.html">
            
                <a href="QRDsj.html">
            
                    
                    QRDsj
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.4" data-path="QR25D.html">
            
                <a href="QR25D.html">
            
                    
                    QR25D
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.5" data-path="QRImage.html">
            
                <a href="QRImage.html">
            
                    
                    QRImage
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.6" data-path="QRResImage.html">
            
                <a href="QRResImage.html">
            
                    
                    QRResImage
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.7" data-path="QRBubble.html">
            
                <a href="QRBubble.html">
            
                    
                    QRBubble
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.8" data-path="QRFunc.html">
            
                <a href="QRFunc.html">
            
                    
                    QRFunc
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.9" data-path="QRLine.html">
            
                <a href="QRLine.html">
            
                    
                    QRLine
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.3" data-path="../how-to-create/">
            
                <a href="../how-to-create/">
            
                    
                    编写样式
            
                </a>
            

            
        </li>
    

    

    <li class="divider"></li>

    <li>
        <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
            Published with GitBook
        </a>
    </li>
</ul>


                </nav>
            
        
    </div>

    <div class="book-body">
        
            <div class="body-inner">
                
                    

<div class="book-header" role="navigation">
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href=".." >使用方法</a>
    </h1>
</div>




                    <div class="page-wrapper" tabindex="-1" role="main">
                        <div class="page-inner">
                            
<div id="book-search-results">
    <div class="search-noresults">
    
                                <section class="normal markdown-section">
                                
                                <h1 id="&#x4F7F;&#x7528;&#x65B9;&#x6CD5;">&#x4F7F;&#x7528;&#x65B9;&#x6CD5;</h1>
<p>&#x76F4;&#x63A5;&#x4F7F;&#x7528;&#x5404;&#x4E2A;&#x4E8C;&#x7EF4;&#x7801;&#x6837;&#x5F0F;&#x7684;&#x7EC4;&#x4EF6;&#x5373;&#x53EF;</p>
<p>&#x6BCF;&#x79CD;&#x4E8C;&#x7EF4;&#x7801;&#x6837;&#x5F0F;&#x53EF;&#x4EE5;&#x53BB;&#x5728;&#x7EBF;&#x4F53;&#x9A8C;&#x7F51;&#x5740;&#x83B7;&#x5F97;&#x76F4;&#x89C2;&#x7684;&#x89C6;&#x89C9;&#x53D8;&#x5316;</p>
<h3 id="&#x57FA;&#x672C;&#x4F7F;&#x7528;&#x65B9;&#x6CD5;">&#x57FA;&#x672C;&#x4F7F;&#x7528;&#x65B9;&#x6CD5;</h3>
<pre><code class="lang-js"><span class="hljs-keyword">import</span> React <span class="hljs-keyword">from</span> <span class="hljs-string">&apos;react&apos;</span>
<span class="hljs-keyword">import</span> { QRNormal } <span class="hljs-keyword">from</span> <span class="hljs-string">&apos;react-qrbtf&apos;</span>

<span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">Component</span> <span class="hljs-keyword">extends</span> <span class="hljs-title">React</span>.<span class="hljs-title">Component</span> </span>{

    render() {
        <span class="hljs-keyword">return</span> (
            <span class="xml"><span class="hljs-tag">&lt;<span class="hljs-name">QRNormal</span>
                <span class="hljs-attr">value</span>=<span class="hljs-string">&quot;react-qrbtf&quot;</span>
                <span class="hljs-attr">className</span>=<span class="hljs-string">&quot;my-qrcode&quot;</span>
                <span class="hljs-attr">styles</span>=<span class="hljs-string">{{</span> <span class="hljs-attr">svg:</span> {<span class="hljs-attr">width:</span> &quot;<span class="hljs-attr">200px</span>&quot;} }}
                <span class="hljs-attr">type</span>=<span class="hljs-string">&quot;round&quot;</span>
                <span class="hljs-attr">size</span>=<span class="hljs-string">{50}</span>
                <span class="hljs-attr">opacity</span>=<span class="hljs-string">{80}</span>
                <span class="hljs-attr">posType</span>=<span class="hljs-string">&quot;planet&quot;</span>
                <span class="hljs-attr">otherColor</span>=<span class="hljs-string">&quot;#33CCCC&quot;</span>
                <span class="hljs-attr">posColor</span>=<span class="hljs-string">&quot;#009999&quot;</span>
            /&gt;</span>
        )
    }
}
</span></code></pre>
<h3 id=""> </h3>
<h3 id="&#x5173;&#x4E8E;-qrcode-&#x7C7B;&#x578B;">&#x5173;&#x4E8E; QRCode &#x7C7B;&#x578B;</h3>
<p>&#x6240;&#x6709;&#x6837;&#x5F0F;&#x90FD;&#x5177;&#x6709;2&#x4E2A;&#x5C5E;&#x6027;: <code>value</code> &#x548C; <code>qrcode</code></p>
<p>&#x5176;&#x4E2D; <code>value</code> &#x662F;&#x9700;&#x8981;&#x7F16;&#x7801;&#x7684;&#x6587;&#x672C;&#x578B;&#x6570;&#x636E;&#xFF0C;<code>qrcode</code>&#x662F;&#x7F16;&#x7801;&#x540E;&#x7684;&#x7279;&#x6B8A;&#x5BF9;&#x8C61;&#xFF0C;&#x91CC;&#x9762;&#x6709;&#x70B9;&#x9635;&#x4FE1;&#x606F;</p>
<p>&#x4EC5;&#x4F7F;&#x7528; <code>value</code> (&#x5747;&#x4E3A;&#x7A7A;&#x5219;<code>value</code>&#x4F7F;&#x7528;&#x9ED8;&#x8BA4;&#x503C;)&#xFF0C;&#x4F1A;&#x5728;&#x663E;&#x793A;&#x4E8C;&#x7EF4;&#x7801;&#x4E4B;&#x524D;&#x8BA1;&#x7B97;&#x51FA; <code>qrcode</code></p>
<p>&#x56E0;&#x6B64;&#xFF0C;&#x5982;&#x679C;&#x9700;&#x8981;&#x5BF9;&#x540C;&#x4E00;&#x6570;&#x636E;&#x751F;&#x6210;&#x4E0D;&#x540C;&#x7684;&#x4E8C;&#x7EF4;&#x7801;&#x6837;&#x5F0F;&#xFF0C;&#x5EFA;&#x8BAE;&#x7528;&#x4E0B;&#x8FF0;&#x65B9;&#x6CD5;&#x663E;&#x5F0F;&#x8BA1;&#x7B97;&#x51FA; <code>qrcode</code> &#x4EE5;&#x51CF;&#x5C11;&#x6027;&#x80FD;&#x5F00;&#x9500;</p>
<pre><code class="lang-js"><span class="hljs-keyword">import</span> React <span class="hljs-keyword">from</span> <span class="hljs-string">&apos;react&apos;</span>;
<span class="hljs-keyword">import</span> { QRDsj, QRNormal } <span class="hljs-keyword">from</span> <span class="hljs-string">&apos;react-qrbtf&apos;</span>;
<span class="hljs-keyword">import</span> {encodeData} <span class="hljs-keyword">from</span> <span class="hljs-string">&quot;react-qrbtf&quot;</span>;

<span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">App</span>(<span class="hljs-params"></span>) </span>{
    <span class="hljs-keyword">const</span> qrcode = encodeData({ text: <span class="hljs-string">&quot;react-qrbtf&quot;</span> });
    <span class="hljs-keyword">return</span> (
        &lt;div className=&quot;App&quot;&gt;
            &lt;QRNormal qrcode={qrcode} /&gt;
            &lt;QRDsj qrcode={qrcode} /&gt;
        &lt;/div&gt;
  );
}
</code></pre>

                                
                                </section>
                            
    </div>
    <div class="search-results">
        <div class="has-results">
            
            <h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
            <ul class="search-results-list"></ul>
            
        </div>
        <div class="no-results">
            
            <h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
            
        </div>
    </div>
</div>

                        </div>
                    </div>
                
            </div>

            
                
                <a href="../" class="navigation navigation-prev " aria-label="Previous page: 基本介绍">
                    <i class="fa fa-angle-left"></i>
                </a>
                
                
                <a href="QRNormal.html" class="navigation navigation-next " aria-label="Next page: QRNormal">
                    <i class="fa fa-angle-right"></i>
                </a>
                
            
        
    </div>

    <script>
        var gitbook = gitbook || [];
        gitbook.push(function() {
            gitbook.page.hasChanged({"page":{"title":"使用方法","level":"1.2","depth":1,"next":{"title":"QRNormal","level":"1.2.1","depth":2,"path":"how-to-use/QRNormal.md","ref":"how-to-use/QRNormal.md","articles":[]},"previous":{"title":"基本介绍","level":"1.1","depth":1,"path":"README.md","ref":"README.md","articles":[]},"dir":"ltr"},"config":{"gitbook":"*","theme":"default","variables":{},"plugins":[],"pluginsConfig":{"highlight":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"}},"file":{"path":"how-to-use/README.md","mtime":"2020-06-28T06:41:48.342Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2020-07-05T08:25:41.444Z"},"basePath":"..","book":{"language":""}});
        });
    </script>
</div>

        
    <script src="../gitbook/gitbook.js"></script>
    <script src="../gitbook/theme.js"></script>
    
        
        <script src="../gitbook/gitbook-plugin-search/search-engine.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-search/search.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-lunr/lunr.min.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-lunr/search-lunr.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-sharing/buttons.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-fontsettings/fontsettings.js"></script>
        
    

    </body>
</html>

